ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
AM_CPPFLAGS = -DDATADIR='"$(datadir)"' -DLIBEXECDIR='"$(libexecdir)"' \
+ -DOSTREE_FEATURES='"$(OSTREE_FEATURES)"' \
-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_34 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_34 \
-DSOUP_VERSION_MIN_REQUIRED=SOUP_VERSION_2_40 -DSOUP_VERSION_MAX_ALLOWED=SOUP_VERSION_40
AM_CFLAGS = $(WARN_CFLAGS)
LT_PREREQ([2.2.4])
LT_INIT([disable-static])
+OSTREE_FEATURES=""
+AC_SUBST([OSTREE_FEATURES])
+
AC_ARG_ENABLE(triggers-only,
AS_HELP_STRING([--enable-triggers-only], [Only build and install triggers]),,
enable_triggers_only=no)
])
AS_IF([test x$have_soup = xyes], [
PKG_CHECK_MODULES(OT_DEP_SOUP, $SOUP_DEPENDENCY)
+ AC_DEFINE(HAVE_LIBSOUP, 1, [Define if we have libsoup.pc])
with_soup=yes
], [
with_soup=no
])
], [ with_soup=no ])
])
+if test x$with_soup != xno; then OSTREE_FEATURES="$OSTREE_FEATURES +libsoup"; fi
AM_CONDITIONAL(USE_LIBSOUP, test x$with_soup != xno)
LIBARCHIVE_DEPENDENCY="libarchive >= 2.8.0"
with_libarchive=no
])
], [ with_libarchive=no ])
+if test x$with_libarchive != xno; then OSTREE_FEATURES="$OSTREE_FEATURES +libarchive"; fi
AM_CONDITIONAL(USE_LIBARCHIVE, test $with_libarchive != no)
AS_IF([test x$cross_compiling != xyes && test -d /etc/kernel && test x$enable_triggers_only != xyes ],
#include "ot-main.h"
#include "otutil.h"
+static gboolean opt_version;
+
+static GOptionEntry main_options[] = {
+ { "version", 0, 0, G_OPTION_ARG_NONE, &opt_version, "Display version", NULL },
+ { NULL }
+};
+
int
ostree_usage (char **argv,
OstreeCommand *commands,
OstreeCommand *commands,
GError **res_error)
{
+ GOptionContext *optcontext;
OstreeCommand *command;
GError *error = NULL;
int cmd_argc;
if (argc < 2)
return ostree_usage (argv, commands, TRUE);
+ optcontext = g_option_context_new ("COMMAND [OPTIONS...]");
+ g_option_context_add_main_entries (optcontext, main_options, NULL);
+ g_option_context_set_ignore_unknown_options (optcontext, TRUE);
+
+ if (!g_option_context_parse (optcontext, &argc, &argv, &error))
+ goto out;
+
+ if (opt_version)
+ {
+ g_print ("%s\n %s\n", PACKAGE_STRING, OSTREE_FEATURES);
+ return 0;
+ }
+
have_repo_arg = g_str_has_prefix (argv[1], "--repo=");
if (have_repo_arg)
set -e
+if ! ostree --version | grep -q -e '\+libarchive'; then
+ exit 77
+fi
+
echo "1..7"
. $(dirname $0)/libtest.sh